import java.util.Scanner;

//统计3个班成绩情况，每个班有5名同学，求出各个班级的平均分和所
// 有班级的平均分
//统计三个班的及格人数
public class MulForExercise01 {
    public static void main(String[] args) {
        double gradeAll = 0;
        double grade = 0;
        double gradeClass = 0;
        int count = 0;
        Scanner scanner = new Scanner(System.in);
        for (int classN = 1; classN <=  3; classN++) {
            for (int stuN = 1; stuN <=  5; stuN++) {
                System.out.println("请输入" + classN + "班第" + stuN + "个学生的成绩：");
                grade = scanner.nextDouble();
                if (grade >= 60) {
                    count++;
                }
                gradeAll += grade;
            }
            gradeClass += gradeAll;
            System.out.println(classN + "班的平均成绩为：" + (gradeAll / 5));
            gradeAll = 0;
        }
        System.out.println("所有班级的平均成绩为：" + (gradeClass / 3));
        System.out.println("及格人数为：" + count);
    }
}
